 package com.xintoucloud.pbs.entity;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.NotEmpty;

@Entity@Table(name="p_partymember")
public class PartyMember {
	@Id@GeneratedValue(strategy=GenerationType.IDENTITY)
    private int pid;
    private String pname;
    private String ppswd;
    private String rname;
    private String sex;
    private String idnum;
    private String phone;
    private String email;
    
    @ManyToOne
    @JoinColumn(name="sid",unique=true,referencedColumnName="sid")
    private PartyMemberState pms;    //党员状态
    
    @ManyToOne	
    @JoinColumn(name="ppid",unique=true,referencedColumnName="ppid")
    private PartyMemberPermission pmp;  //党员(管理员)权限
    
    @ManyToOne 	
    @JoinColumn(name="oid",unique=true,referencedColumnName="oid")
    private Organization org;   // 所属组织

	public int getPid() { 
		return pid;
	}

	public void setPid(int pid) {
		this.pid = pid;
	}

	public String getPname() {
		return pname;
	}

	public void setPname(String pname) {
		this.pname = pname;
	}

	public String getPpswd() {
		return ppswd;
	}

	public void setPpswd(String ppswd) {
		this.ppswd = ppswd;
	}

	public String getRname() {
		return rname;
	}

	public void setRname(String rname) {
		this.rname = rname;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getIdnum() {
		return idnum;
	}

	public void setIdnum(String idnum) {
		this.idnum = idnum;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public PartyMemberState getPms() {
		return pms;
	}

	public void setPms(PartyMemberState pms) {
		this.pms = pms;
	}

	public PartyMemberPermission getPmp() {
		return pmp;
	}

	public void setPmp(PartyMemberPermission pmp) {
		this.pmp = pmp;
	}

	public Organization getOrg() {
		return org;
	}

	public void setOrg(Organization org) {
		this.org = org;
	}
}
